import request from '@/utils/request'

// api接口列表
const api = {
  list:'bike.maintenance/list',
  service: 'bike.maintenance/service',
  address: 'bike.maintenance/address',
  add:'bike.maintenance/add',
  closed: 'bike.maintenance/closed',
  retrieve:'bike.maintenance/retrieve',
  finish:'bike.maintenance/finish'
}

export const service = (param) => {
  return request.get(api.service, param)
}

export const address = (param) => {
  return request.get(api.address, param)
}

export const add = (data) => {
  return request.post(api.add, { form: data })
}

export const list = (param) => {
  return request.get(api.list, param)
}

export const closed = (maintenanceId) => {
  return request.post(api.closed, { maintenanceId })
}

export const finish = (maintenanceId) => {
  return request.post(api.finish, { maintenanceId })
}

export const retrieve = (maintenanceId,data) => {
  return request.post(api.retrieve, {maintenanceId,form:data})
}